package my.bc.webdav.client.test;

import my.bc.webdav.client.ServerInfo;
import my.bc.webdav.client.UriUtil;

import org.apache.commons.httpclient.util.URIUtil;
import org.junit.Before;
import org.junit.Test;

public class UrlTester
{
  @Before
  public void prepare()
  {
    
  }
  
  //@Test
  public void urlEscapeTester()
  {
    try
    {
      FgtFengServer server = new FgtFengServer();
      final String path = "MarketingGraphics/documentLibrary/MARKETING ASSETS/ADVERTISING/Fortinet Massbay summit half page b&w ad";
      String escapedUrl = server.getUriString( path );
  
      //String escapedUrl = UriUtil.deepEscape( url );
      System.out.println( path + ": " + escapedUrl );
    }
    catch( Exception e )
    {
      e.printStackTrace();
    }
  }
  
  @Test
  public void testCase()
  {
    try
    {
      ServerInfo serverInfo = new FgtFengServer();
      
      String path = "1 2#3$4%5&6`7/8:9;10<11=12>13?14[15\16]17^18{19|20}21~22\"23\'24+25!26(27)28你好";
      System.out.println( path );
      System.out.println( serverInfo.getUriString( path ) );
    }
    catch( Exception e )
    {
      e.printStackTrace();
    }
  }

}
